#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
	char s[200];
	while(scanf(" %s",s)!=EOF)
	{
		int len = strlen(s);
		int numL = 0,numR = 0,numU = 0,numD = 0;
		int ans1,ans2;
		for(int i = 0;i<len;i++)
		{
			if(s[i]=='L') numL++;
			else if(s[i]=='U') numU++;
			else if(s[i]=='D') numD++;
			else numR++;
		}
		if(numR==0&&numL==abs(numD-numU)) puts("Yes");
		else if(numL==0&&numR==abs(numD-numU)) puts("Yes");
		else if(numU==0&&numD==abs(numL-numR)) puts("Yes");
		else if(numD==0&&numU==abs(numL-numR)) puts("Yes");
		else puts("No");
	}
}
